Skip to content

Integrate trait impls into template specialization logic.#766

Merged
copybara-service[bot] merged 1 commit intomainfrom
test_890047063
Mar 30, 2026
Merged

Integrate trait impls into template specialization logic.#766
copybara-service[bot] merged 1 commit intomainfrom
test_890047063

Conversation

@copybara-service
Copy link
Copy Markdown

@copybara-service copybara-service bot commented Mar 26, 2026

Integrate trait impls into template specialization logic.

Trait impls predate the logic around emitting template specializations,
and so had special case logic to emit in the right location. Now that we
have actual logic for placing template specializations correctly in
bindings, we don't need the special case logic.

This revealed an issue around template specialization where trait impls
can, understandably, produce specializations of Result/Option. I
think a simpler hiearchy of handle trait impls -> handle result/option specializations would suffice, but I opted to use a
fixpoint of specializations instead so that such issues do not continue
to arise in the future. It is absolutely debatable if this is warranted.

@copybara-service copybara-service bot force-pushed the test_890047063 branch 7 times, most recently from 0d4ef94 to aaaef64 Compare March 30, 2026 17:38
Trait impls predate the logic around emitting template specializations,
and so had special case logic to emit in the right location. Now that we
have actual logic for placing template specializations correctly in
bindings, we don't need the special case logic.

This revealed an issue around template specialization where trait impls
can, understandably, produce specializations of `Result`/`Option`. I
think a simpler hiearchy of `handle trait impls` -> `handle
result/option specializations` would suffice, but I opted to use a
fixpoint of specializations instead so that such issues do not continue
to arise in the future. It is absolutely debatable if this is warranted.

PiperOrigin-RevId: 891794205
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant